import requests from "./request";
import mockRequest from './mockAjax'

export const reqCategoryList = () => requests({ url: '/product/getBaseCategoryList', method: 'get' });
export const reqGetBannerList = () => mockRequest({ url: '/banner', method: 'get' })
export const reqGetFloorList = () => mockRequest({ url: '/floor', method: 'get' })
export const reqGetSearchInfo = (params) => requests({ url: '/list', method: 'post', data: params });
export const reqGetGoodsInfo = (skuid) => requests({ url: `/item/${skuid}`, method: 'get' })
export const reqGetShopCar = (skuid, skuNum) => requests({ url: `/cart/addToCart/${skuid}/${skuNum}`, method: 'post' })
export const reqCartList = () => requests({ url: '/cart/cartList', method: 'get' })
export const reqDeleteCartbyid = (skuid) => requests({ url: `/cart/deleteCart/${skuid}`, method: "delete" })
export const reqUpdateChecked = (skuid, isChecked) => requests({ url: `/cart/checkCart/${skuid}/${isChecked}`, method: 'get' })
export const reqGetCode = (phone) => requests({ url: `/user/passport/sendCode/${phone}`, method: 'get' })
export const reqFinishRegister = (data) => requests({ url: '/user/passport/register', data, method: 'post' })
export const reqUserLogin = (user) => requests({ url: "/user/passport/login", data: user, method: 'post' })
export const reqUserInfo = () => requests({ url: '/user/passport/auth/getUserInfo', method: 'get' })
export const reqLoginOut = () => requests({ url: '/user/passport/logout', method: 'get' })
export const reqUserAddress = () => requests({ url: "/user/userAddress/auth/findUserAddressList", method: 'get' })
export const reqTradeList = () => requests({ url: '/order/auth/trade', method: "get" })
export const reqSubmitTrade = (tradeNo, tradeInfo) => requests({ url: `/order/auth/submitOrder?tradeNo=${tradeNo}`, data: tradeInfo, method: 'post' })
export const reqPayInfo = (orderId) => requests({ url: `/payment/weixin/createNative/${orderId}`, method: 'get' })
export const reqPayState = (orderId) => requests({ url: `/payment/weixin/queryPayStatus/${orderId}`, method: 'get' })
export const reqPersonCenter = (page, limit) => requests({ url: `/order/auth/${page}/${limit}`, method: 'get' })




